import React, { Component } from 'react'
import Child1 from './child1'
/* import VirDom from './virtualDOM' */

export default class child1 extends Component {
    state={
        msg:'here is 父组件'
    }
    componentDidMount(){
        // console.log(this.refs);
        // this.refs.virdom_ref.text()
        
        
        // this.p_ref.style.color='teal'

        this.p_ref.current.style.color='teal'

    }
    p_ref=React.createRef()
    recv_data(msg){
        console.log(msg);
    }
    render() {
        
        return (
            <div>
                {/* <p ref='p_ref'>父组件</p> */}

                {/* <p ref={dom=>this.p_ref=dom}>父组件</p> */}

                <p ref={this.p_ref}>父组件</p>
                {/* <Child1 message={this.state.msg}></Child1> */}

                <Child1 send={this.recv_data.bind(this)}></Child1>
                {/* <VirDom ref='virdom_ref'>

                </VirDom> */}
            </div>
        )
    }
}
